from distutils.command.config import config
from trainer.class_worker import ClassWorker
from easydict import EasyDict as edict
import yaml
import argparse

def trian(config):
    cls_worker = ClassWorker(config)    
    # cls_worker.summary()
    cls_worker.train()



if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '-c',
        '--config',
        type=str,
        default='config/default.yml',
        help='Configuration yaml file PATH.')
    opt = parser.parse_args()
    with open(opt.config, encoding='utf-8') as f:
        data_dict = yaml.load(f, Loader=yaml.FullLoader)
    cfg = edict(data_dict)
    # ClassWorker(config=cfg).summary()
    trian(config=cfg)